const webpack = require('webpack');
const path  = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');

const htmlWebpackPlugin = new HtmlWebpackPlugin({
  title: 'toReact',
  template: path.join(__dirname, './index.html')
});
module.exports = {
    entry:{
        main:"./main.js"
    },
   output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
  },
  module: {
      rules: [
          {
              test: /\.(js)$/,
              use: {
                  loader:'babel-loader',
                  options:{
                       "presets":[
                            "@babel/preset-env"
                        ],
                      plugins:[["@babel/plugin-transform-react-jsx",{"pragma":"toReact.createElement"}]]
                  }
                }
          }
      ]
  },
mode:"development",
plugins:[
    htmlWebpackPlugin
],
optimization: {
    minimize: false
}
}